﻿Imports IICBusinessLogic.PeriodProcessing

Namespace PeriodProcessing

    Public Interface IReversalRecordsProvider
        Sub setReversalRecords(ByVal pr As PeriodProcessReverser, ByVal periodProcess As PeriodProcess)
    End Interface

    Public Class ReversalRecordsProvider
        Implements IReversalRecordsProvider

        Public Sub setReversalRecords(ByVal pr As PeriodProcessReverser, _
                                      ByVal periodProcess As PeriodProcess) Implements IReversalRecordsProvider.setReversalRecords

            Const EARNED_WHERE As String = "EarnedPeriodProcessId={0}"
            Const SATISFIED_WHERE As String = "SatisfiedPeriodProcessId={0}"

            pr.ClassMembers = pr.classMemberMapper.findList("PeriodProcessId={0}", periodProcess.PeriodProcessId)
            pr.DiplomasEarned = pr.diplomaEarnedMapper.findList(EARNED_WHERE, periodProcess.PeriodProcessId)
            pr.CertificationsEarned = pr.certificationEarnedMapper.findList(EARNED_WHERE, periodProcess.PeriodProcessId)
            pr.DiplomaSatisfiedRequirements = pr.diplomaSatisfiedMapper.findList(SATISFIED_WHERE, periodProcess.PeriodProcessId)
            pr.CertificationSatisfiedRequirements = pr.certSatReqMapper.findList(SATISFIED_WHERE, periodProcess.PeriodProcessId)

        End Sub

    End Class
End Namespace